## Adapted from https://rpubs.com/Koundy/71792

theme_baselike <- function(base_size=12, base_family="sans") {
      library(grid)
      library(ggthemes)
      (theme_foundation(base_size=base_size, base_family=base_family)
       + theme(#plot.title = element_text(face = "bold",
                                         #size = rel(1.2), hjust = 0.5),
               text = element_text(),
               panel.background = element_rect(colour = NA, fill = "white"),
               plot.background = element_rect(colour = NA, fill = "white"),
               panel.border = element_rect(colour = "black", fill = NA, size = 1),
               # panel.border = element_rect(colour = NA),
               #axis.title = element_text(face = "bold",size = rel(1)),
               axis.title.y = element_text(angle=90,vjust =2),
               axis.title.x = element_text(vjust = -0.2),
               axis.text = element_text(), 
               # axis.line.x = element_line(colour="black"),
               # axis.line.y = element_line(colour="black"),
               axis.ticks = element_line(),
               #panel.grid.major = element_line(colour="#f0f0f0"),
               panel.grid.major = element_blank(),
               panel.grid.minor = element_blank(),
               legend.key = element_rect(colour = NA),
               #legend.position = "bottom",
               legend.position = "right",
               legend.direction = "vertical",
               #legend.direction = "horizontal",
               legend.key.size= unit(.5, "cm"),
               #legend.margin = unit(1, "cm"),
               #legend.title = element_text(face="italic"),
               plot.margin=unit(c(10,5,5,5),"mm"),
               strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
               #strip.text = element_text(face="bold")
       ))
      
}

# scale_fill_Publication <- function(...){
#       library(scales)
#       discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
#       
# }
# 
# scale_colour_Publication <- function(...){
#       library(scales)
#       discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
#       
# }

bg_t <- .15

ggyellow = '#eac435'
ggblue = '#0081b8'
gggreen = '#07c592'
ggred = '#fb4d3d'
ggpurple = '#392B58'
ggorange = '#E17A51'